#ifndef PRIMITIVEDB_H_
#define PRIMITIVEDB_H_

#include "DataBase.h"
#include "PointDb.h"
#include "ConstraintDb.h"
#include "../basic/Coordinate.h"
#include "../primitive/Line.h"
#include "../primitive/Circle.h"
#include "../primitive/Segment.h"

namespace common {

class PrimitiveDb: public DataBase<Primitive*> {
	PointDb* pointDb;
	ConstraintDb* constraintDb;
public:
	PrimitiveDb(PointDb* pointDb,ConstraintDb* constraintDb);

	void remove(int id) throw (MyException);
	void relax();

	Line* addLine(Coordinate* c1,Coordinate* c2);
	Line* addLine(Coordinate c1,Coordinate c2);
	Circle* addCircle(Coordinate* c1,Coordinate* c2);
	Circle* addCircle(Coordinate c1,Coordinate c2);
	Segment* addSegment(std::list<Coordinate*> cSet);
	Segment* addSegment(std::list<Coordinate> cSet);
	virtual ~PrimitiveDb();
};

}

#endif /* PRIMITIVEDB_H_ */
